<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="/layer/layer.js"></script>
</head>
<body>


<div id="addGroup" class="container">
    <form class="form-horizontal" action="" method="post">
        <input name="id" hidden>

        <div class="form-group">
            <label for="name" class="col-sm-2 control-label">组名</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="name" placeholder="组名" name="name" v-model="iconGroupInfo.name">
            </div>
        </div>

        <div class="form-group">
            <label for="remark" class="col-sm-2 control-label">备注</label>
            <div class="col-sm-10">
                <textarea name="remark" class="form-control" id="remark" v-model="iconGroupInfo.remark"></textarea>
            </div>
        </div>


        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="button" class="btn btn-default" @click="addGroup()">保存</button>
            </div>
        </div>
    </form>

</div>


<script>
    new Vue({
        el: "#addGroup",
        data: {
           iconGroupInfo: {},

        },
        created() {

        },
        methods: {
            addGroup() {
                var vm = this;
                $.post("/group/add", vm.iconGroupInfo, function (response) {
                    if (response.code == 200) {
                        parent.layer.close(parent.layer.getFrameIndex(window.name));
                    }
                })
            }
        }

    })
</script>
</body>
</html>